package com.shycloud.mido.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.member.api.dto.TeacherApprovalDTO;
import com.shycloud.mido.member.api.vo.TeacherApprovalVO;
import com.shycloud.mido.member.api.entity.TeacherApproval;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 平台认证教师表
 *
 * @author jtzhang
 * @date 2019-02-27 13:16:46
 */
public interface TeacherApprovalMapper extends BaseMapper<TeacherApproval> {

	String getTeacher0Num(@Param("optId") Integer optId);

	/** 获取已审核的教师数量 */
	String getTeacher1Num(@Param("optId") Integer optId);

	/**
	 * 分页查询教师资格认证
	 *
	 * @param page               分页
	 * @param teacherApprovalDTO 查询参数
	 * @return list
	 */
	IPage<List<TeacherApprovalVO>> getTeacherApprovalVosPage(Page page, @Param("query") TeacherApprovalDTO teacherApprovalDTO);

	/**
	 * 通过审核
	 *
	 * @param id id
	 * @return
	 */
	boolean accept(@Param("id") String id);

	/**
	 * 驳回审核
	 *
	 * @param id id
	 * @return
	 */
	boolean reject(@Param("id") String id, @Param("remarks") String remarks);

	/**
	 * 查询科目
	 *
	 * @param memberId
	 * @return
	 */
	List<String> getTeacherApprovalSubjectId(@Param("memberId") String memberId);

	/**
	 * 查询证书照片
	 *
	 * @param memberId
	 * @return
	 */
	List<String> getTeacherApprovalProPic(@Param("memberId") String memberId);


	/**
	 * @param teacher
	 * @return
	 */
	boolean insertTeacherInfo(@Param("teacher") TeacherApproval teacher);

	/**
	 * 更新教师认证
	 *
	 * @param memberId 会员ID
	 * @param status   状态
	 * @return
	 */
	boolean updIsTeacher(@Param("memberId") String memberId, @Param("status") String status);

}
